package edu.hcnu.common;

import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;

/**
 * @description:
 * @author: Administrator
 * @time: 2023/2/9 23:27
 */
@Data
@AllArgsConstructor
@NoArgsConstructor
public class ServerResponse {
    private int code;
    private String message;
    private Object data;
    public static ServerResponse success(int code,String message){
        return new ServerResponse(code,message,null);
    }
    public static ServerResponse success(int code,String message,Object data){
        return new ServerResponse(code,message,data);
    }
    public static ServerResponse fail(int code,String message){
        return new ServerResponse(code,message,null);
    }
}
